﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace IngredSubTool
{
    /// <summary>
    /// Interaction logic for BookmarkView.xaml
    /// </summary>
    public partial class BookmarkView : UserControl, IAppPage
    {

        public List<Substitution> bookSubs = new List<Substitution>();
        public BookmarkView()
        {
            InitializeComponent();
            Menu.Content = new SideMenu();
            BookmarkGrid.ItemsSource = MainWindow.session.bookmarkSubs;
           

        }

        private void Back(object sender, RoutedEventArgs e)
        {
            //PageSwitcher.Switch(MainWindow.session.lastPage);
            PageSwitcher.SwitchBack();
        }

        public void BookmarkAdd(Substitution subObj)
        {
            bookSubs.Add(subObj);
        }

        private void RatiosBtn_Click(object sender, RoutedEventArgs e)
        {
            Substitution subtemp = (Substitution)BookmarkGrid.CurrentItem;
            MainWindow.session.selectedSub = subtemp;
            //MainWindow.session.lastPage = new BookmarkView();
            //MainWindow.session.addToPrevPageList(new BookmarkView());
            PageSwitcher.SwitchForward(new ConversionCalcView());
        }
      
    }
}
